/* This do-file replicates Figure 5 in Kerim Can Kavakli's article "Women's murders and the interaction between gender (in)equality and
economic development: A subnational analysis in Turkey" (Journal of Interpersonal Violence)	*/

* Set working directory
cd "..."

* LOAD dataset
use "wm_replication_dataset_2020_09_25.dta", clear


scalar define tc_pop_2017 = 80000000

* regression
quietly: nbreg all_wm_prov i.year ethnic_t ethnic_k c.mosques_perk c.ln_casualty c.ln_casualty#i.ceasefire c.ln_gdppc_cons##(c.fm c.divorce_rate_ma5), cl(prov_code) exposure(total_pop)
sum fm divorce_rate_ma5 ln_gdppc_cons ethnic* if e(sample)==1

* avg province
margins, predict(ir) at(year=2017 ceasefire=0) atmeans noatlegend
scalar avg_prov= el(r(b), 1,1)* tc_pop_2017

* richer province, all else equal
margins, predict(ir) at(year=2017 ceasefire=0 ln_gdppc_cons=4.9) atmeans noatlegend
scalar high_gdp= el(r(b), 1,1)* tc_pop_2017

* more educ equal, poor province
margins, predict(ir) at(year=2017 ceasefire=0 fm_diff_educ=-0.08 ln_gdppc_cons=3.9) atmeans noatlegend
scalar high_educ_low_gdp= el(r(b), 1,1)* tc_pop_2017
* more educ equal, rich province
margins, predict(ir) at(year=2017 ceasefire=0 fm_diff_educ=-0.08 ln_gdppc_cons=4.9) atmeans noatlegend
scalar high_educ_high_gdp= el(r(b), 1,1)* tc_pop_2017

* high divorce, poor province
margins, predict(ir) at(year=2017 ceasefire=0 divorce_rate_ma5=1.9 ln_gdppc_cons=3.9) atmeans noatlegend
scalar high_div_low_gdp= el(r(b), 1,1)* tc_pop_2017
* high divorce, rich province
margins, predict(ir) at(year=2017 ceasefire=0 divorce_rate_ma5=1.9 ln_gdppc_cons=4.9) atmeans noatlegend
scalar high_div_high_gdp= el(r(b), 1,1)* tc_pop_2017

scalar list